FROM ifile-base:latest

WORKDIR ${APP_HOME}

COPY ./deploy/docker/docker-entrypoint.sh ./docker-entrypoint.sh
COPY ./ ./iFile/

USER root

RUN chown ${APP_USER}:${APP_GROUP} docker-entrypoint.sh \
    && chown -R ${APP_USER}:${APP_GROUP} iFile \
    && chmod +x docker-entrypoint.sh

USER ${APP_USER}

WORKDIR ${APP_HOME}/iFile

RUN ${APP_HOME}/ienv/bin/pip install --editable .

WORKDIR ${APP_HOME}

ENTRYPOINT ["./docker-entrypoint.sh"]
